#ifndef DATABASEMANAGER_H
#define DATABASEMANAGER_H

#include <QObject>
#include <QDir>

namespace Core
{

class DatabaseManager : public QObject
{
    Q_OBJECT
private:
    QDir storageDir;
    QDir listDir;
    int level;
public:
    explicit DatabaseManager(const QString& storageName);

    void store(const QString& fileName, const QString& data);
    QString read(const QString& fileName);

    bool exists(const QString& fileName);

    void storeList(const QString& name, const QStringList& items);
    QString getRandomListItem(const QString& listName);
    QStringList getList(const QString& name);

    static QString databaseRootPath();
public slots:
    void startSubStorage(const QString& subStorageName);
    void finishSubStorage();
};

}

#endif // DATABASEMANAGER_H
